import React from 'react'

interface RouterMeta {
    title: string;
    icon?: string;
}

export interface IRoute {
    path: string;
    meta: RouterMeta;
    component?: any;
    redirect?: boolean;
    children?: IRoute[];
    hidden?: boolean;
}

const router: IRoute[] = [
    {
        path: '/',
        meta: {
            title: '主应用'
        },
        component: React.lazy(() => import('../layout/index')),
        children: [
            {
                path: '/welcome',
                meta: {
                    title: '欢迎页'
                },
                hidden: true,
                component: React.lazy(() => import('../views/home/index'))
            },
            {
                path: '/game-brain/*',
                meta: {
                    title: '游戏大脑'
                },
                hidden: true,
                component: React.lazy(() => import('../views/game-brain/index'))
            }
        ]
    },
    {
        path: '404',
        meta: {
            title: '404'
        },
        redirect: false,
        component: React.lazy(() => import('../views/home/404'))
    }
]

// 动态路由
export const loadAsyncRoutes = async () => {}

export default router